<template>
  <div class="breadcrumb">
    <ul>
      <li v-for="(item, index) in breadcrumbList" :key="index">
        <router-link :to="item.path" v-if="item.path">
          {{ item.name }}
        </router-link>
        <span v-else>{{ item.name }}</span>
        <i
          class="el-icon-d-arrow-right"
          v-if="index < breadcrumbList.length - 1"
        ></i>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "Breadcrumb",
  props: {
    breadcrumbList: {
      type: Array,
      required: true,
    },
  },
};
</script>
<style scoped>
.breadcrumb {
  font-size: 15px;
  line-height: 1.5;
  color: #fff;
}

.breadcrumb ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.breadcrumb ul li {
  margin-right: 5px;
  display: flex;
  align-items: center;
}

.breadcrumb ul li a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb ul li a:hover {
  text-decoration: underline;
}
i {
  font-size: 10px;
}
</style>